class XX {
  constructor(private name:string,public age:number,readonly sex:string) {

  }
}
const xx=new XX('张三',18,'男')
// xx.sex='女' //报错  readonly声明的是只读
console.log(xx);
